header-ids: avoid conflicting ids (fixes #661)#662
header-ids: avoid conflicting ids (fixes #661)#662pmjdebruijn wants to merge 2 commits intotrentm:masterfrom
Conversation
|
Haven't had the chance to test this yet, but is changing the separator char a complete fix or is it just moving the problem around? What happens in this case, modified from the issue raised: To me, it feels like the problem is the duplicate checking mechanism, not the suffix char. |
|
Actually I've tested this on my machine and this works fine. My only concern now is this will change the format of generated header IDs in a way that isn't compatible with previous library versions, so any existing markdown docs that link to |
|
Yeah I don't love the lack of backwards compat. Is there a possible fix that keeps the original separator? |
|
Keep in mind that using a different separator also makes the id make more sense when the id is "whatever-1:2" I know this is the second instance of "Whatever 1"... but if it's encoded as "whatever-1-2", I can't tell whether it's the second instance of "Whatever 1" or it's the first instance of "Whatever 1 2". So I think it'll be difficult to make this as robust without changing the separator really. |
|
An approach could be to make the duplicate separator configurable... Where the default initially stays In the next major release of markdown2 you change the default to |
Changes the separator from '-' to ':' to avoid generating accidental header id conflicts.